using ASP;
using HoWave.Web;
using HoWave.Web.Admin;
using System;
using System.Data;
using System.Web.Profile;
using System.Web.SessionState;
using System.Web.UI.WebControls;
public class HL_Admin_Admin_EditComment : Admin, IRequiresSessionState
{
	protected Label Label_UserName;
	protected Label Label_DateTime;
	protected Label Label_ProductName;
	protected Label Label_Content;
	protected Label Label_Level;
	protected Button Button_Show;
	protected Button Button_Hidden;
	protected DefaultProfile Profile
	{
		get
		{
			return (DefaultProfile)this.Context.Profile;
		}
	}
	protected global_asax ApplicationInstance
	{
		get
		{
			return (global_asax)this.Context.ApplicationInstance;
		}
	}
	protected void Page_Load(object sender, EventArgs e)
	{
		if (!base.IsPostBack)
		{
			this.initialPage();
		}
	}
	protected void initialPage()
	{
		int id = Convert.ToInt32(base.Request.QueryString["Id"]);
		Shop_Comment shop_Comment = new Shop_Comment();
		DataTable attributesByID = shop_Comment.GetAttributesByID(id);
		this.Label_UserName.Text = attributesByID.Rows[0]["UserName"].ToString();
		this.Label_DateTime.Text = attributesByID.Rows[0]["DateTime"].ToString();
		this.Label_ProductName.Text = attributesByID.Rows[0]["ProductName"].ToString();
		this.Label_Content.Text = attributesByID.Rows[0]["Content"].ToString();
		this.Label_Level.Text = attributesByID.Rows[0]["Level"].ToString();
	}
	protected void Button_Show_Click(object sender, EventArgs e)
	{
		int id = Convert.ToInt32(base.Request.QueryString["Id"]);
		Shop_Comment shop_Comment = new Shop_Comment();
		if (shop_Comment.UpdateComment(1, id))
		{
			this.WriteErrMsg("", "设为显示成功！", "Admin_ListComment.aspx");
		}
		else
		{
			this.WriteErrMsg("", "设为显示失败！", "Admin_ListComment.aspx");
		}
	}
	protected void Button_Hidden_Click(object sender, EventArgs e)
	{
		int id = Convert.ToInt32(base.Request.QueryString["Id"]);
		Shop_Comment shop_Comment = new Shop_Comment();
		if (shop_Comment.UpdateComment(0, id))
		{
			this.WriteErrMsg("", "设为隐藏成功！", "Admin_ListComment.aspx");
		}
		else
		{
			this.WriteErrMsg("", "设为隐藏失败！", "Admin_ListComment.aspx");
		}
	}
}
